package com.example.springboot.mapper;

import com.example.springboot.controller.request.BaseRequest;
import com.example.springboot.entity.Order;
import com.example.springboot.mapper.po.ProductSalesPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper //@Mapper注解将mapper标注为spring的一个组件
//使用mapper将数据传入数据库
public interface OrderMapper {

//用户列表
    List<Order> list();

    List<Order> listByCondition(BaseRequest baseRequest);

    void save(Order order);

    Order getById(Integer id);

    Order getByUserName(String userName);

    void updateById(Order order);

    void deleteById(Integer id);

    List<ProductSalesPO> getSalesByTimeRange(@Param("timeRange") String timeRange);
//    Order getByOrderName(String orderName);
//
//    Order getByOrderNameAndPassword(@Param("orderName") String orderName, @Param("password") String password);

}
